<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
  <head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<link rel="stylesheet" href="css/custom/reset.css">
    <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
    <link rel="stylesheet" href="css/ui-color.css">
	<link rel="stylesheet" href="css/ui-res.css">
	<link rel="stylesheet" href="css/ui-media.css">
	<link rel="stylesheet" href="css/custom/base_640.css">
	<script src="js/jquery-1.8.0.min.js"></script>
    <script src="js/zy_control.js">
    </script>
    <script src="js/zy_click.js">
    </script>
	<script src="js/guoguojie.js"></script>
	<script src="js/default_unit.js" type="text/javascript"></script>
  </head>
<body class="um-vp" ontouchstart>
	 <div class="content">
	 	<div class="edit_info_box">
	 		<div class="e_i_pd_s1">
	 			<div class="edit_det_wrap">
	 				<div class="edit_det_form">
	 					<div class="com_lr edit_avater">
	 						<div class="l_box">
	 							<a href="#"  class="pic"><img id="avatar" src="images/def_avater_170x170.png" class="block" /></a>
							</div>
							<!--<a href="#" class="upload_avater">上传头像 <img src="images/icon_5.png" /></a>-->
	 					</div>
	 				</div>
					<div class="edit_det_form">
						<span class="lbl fl">性别：</span>
						<div class="sex_box">
    						<span>女</span><i class="cb" id="female"><img id="female_img" src="images/cb_1.png"></i> <span>男</span><i class="cb" id="male"><img id="male_img" src="images/cb_1.png"></i>
    					</div>
						<input type="hidden" value="" name="sex" id="sex">
					</div>
					<div class="edit_det_form">
						<span class="lbl fl">昵称：</span>
						<input type="text" class="def txt" value="" readonly="readonly" id="nickname">
					</div>
					<div class="edit_det_form">
						<span class="lbl fl">简介：</span>
						<textarea class="tt" id="intro"></textarea>
					</div>
	 			</div>
	 		</div>
	 	</div>
		
    	
    </div>
</body>
<script>

zy_init();
window.uexOnload=function(type)
{
	if(!type){
		uexWindow.setBounce("1");
		uexWindow.showBounceView("0","#FFF","0");
		uexWindow.showBounceView("1","#FFF","0");
		uexWindow.notifyBounceEvent("1","1");
		
		
		if(window.localStorage){
			uexWindow.toast(1, 5, "正在加载请稍后", 0);
			var login_name = localStorage.getItem("loginName");
			var login_pwd = localStorage.getItem("loginPwd");
			var ajaxId = Math.floor(Math.random() * 100);
			var url = domainName+"mobile/getMember.htm";
			uexXmlHttpMgr.open(ajaxId, 'POST', url, 20000);
			uexXmlHttpMgr.setPostData(ajaxId, "0", "loginName", login_name);
	　　　	uexXmlHttpMgr.setPostData(ajaxId, "0", "loginPwd", login_pwd);
			uexXmlHttpMgr.onData = function(opcode, status, data){
				uexWindow.closeToast();
				if (status == -1){
					alert('网络连接出错，请检查网络!');
				}else if (status == 1){
					var ret = $.parseJSON(data);
					if(ret.success == 'true'){
						$("#sex").val(ret.sex);
						$("#nickname").val(ret.nickname);
						$("#avatar").attr('src',ret.avatar);
						$("#intro").val(ret.intro);
						if(ret.sex =='F'){
							$("#female_img").attr('src',"images/cb_2.png");
						}else if(ret.sex =='M'){
							$("#male_img").attr('src',"images/cb_2.png");
						}
					}else{
						uexWindow.alert('错误','用户名或密码错误','确定');
					}
							
					uexXmlHttpMgr.close(ajaxId);
				}
			}
			uexXmlHttpMgr.send(ajaxId);
		}
    }
	
	
	
}

function saveMember(){
	uexWindow.toast(1, 5, "正在加载请稍后", 0);
	var intro = $("#intro").val();
	var sex = $("#sex").val();
	var login_name = localStorage.getItem("loginName");
	var login_pwd = localStorage.getItem("loginPwd");
	var ajaxId = Math.floor(Math.random() * 100);
	var url = domainName+"mobile/savepersonal.htm";
	uexXmlHttpMgr.open(ajaxId, 'POST', url, 20000);
	uexXmlHttpMgr.setPostData(ajaxId, "0", "loginName", login_name);
	uexXmlHttpMgr.setPostData(ajaxId, "0", "loginPwd", login_pwd);
	uexXmlHttpMgr.setPostData(ajaxId, "0", "intro", intro);
	uexXmlHttpMgr.setPostData(ajaxId, "0", "sex", sex);
	uexXmlHttpMgr.onData = function(opcode, status, data){
		uexWindow.closeToast();
		if (status == -1){
			alert('网络连接出错，请检查网络!');
		}else if (status == 1){
			var ret = $.parseJSON(data);
			if(ret.success == 'true'){
				uexWindow.alert('恭喜',ret.msg,'确定');
			}else{
				uexWindow.alert('错误',ret.msg,'确定');
			}
					
			uexXmlHttpMgr.close(ajaxId);
		}
	}
	uexXmlHttpMgr.send(ajaxId);
}
</script>
</html>
